package com.highcom.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@Slf4j
//@ControllerAdvice
public class GlobalExceptionHandler {


    @ExceptionHandler(value = {ArithmeticException.class, NullPointerException.class})
    public String handleArithException(Exception ex){
        log.error("错了，{}",ex);
        return "login";// 指定之徒位置，就不去500页面了；
    }

}
